import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import TypeNav from '@/components/TypeNav'
import Carousel from '@/components/Carousel'
import Pagination from '@/components/Pagination/Pagination.vue'
Vue.component(TypeNav.name,TypeNav)
Vue.component(Carousel.name, Carousel)
Vue.component(Pagination.name,Pagination)
Vue.config.productionTip = false
//执行mockjs  模拟数据
import '@/mock/mockServe.js'

//引入所有的api请求
import * as API from '@/api/index'

import { Button ,MessageBox} from 'element-ui'
Vue.use(Button)

Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
//引入swiper的css样式
import 'swiper/css/swiper.css'
import { reqCategoryList } from './api/index'
reqCategoryList()

//引入懒加载插件
import VueLazyload  from 'vue-lazyload'
//注册插件并配置
Vue.use(VueLazyload, { 
  loading: require('@/assets/images/983615.jpg'),
})



new Vue({
  //注册事件总线
  beforeCreate() {
    Vue.prototype.$bus = this,
      Vue.prototype.$API = API
  },
  router,
  store,
  render: h => h(App)
}).$mount('#app')
